<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.2"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:security="http://www.springframework.org/security/tags"
	xmlns:u="urn:jsptagdir:/WEB-INF/tags/util/"
	xmlns:s="http://www.springframework.org/tags">
	<jsp:directive.page contentType="application/xhtml+xml" pageEncoding="UTF-8" />
	<c:url value="/" var="rootURL" />
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<div class="brand">CapicsouBank</div>
				<nav class="nav-collapse">
					<ul class="nav">
						<u:active active="${menu}" value="home" url="home" dropdown="false" />
						<u:active active="${menu}" value="accounts" url="#" dropdown="true">
							<c:set var="firstItem" value="true" />
							<c:forEach items="${accountsMap}" var="account">
								<c:choose>
									<c:when test="${firstItem}">
										<c:set var="firstItem" value="false" />
									</c:when>
									<c:otherwise>
										<li class="divider"></li>
									</c:otherwise>
								</c:choose>
								<li class="nav-header">${account.value}</li>
								<li><a href="${rootURL}account/${account.key}"><s:message code="navbar.accounts.details" /></a></li>
								<li><a href="${rootURL}account/${account.key}/card"><s:message code="navbar.accounts.cards" /></a></li>
							</c:forEach>
						</u:active>
						<u:active active="${menu}" value="transfers" url="#" dropdown="true">
							<li><a href="${rootURL}transfer"><s:message code="navbar.transfers.do" /></a></li>
							<li class="divider"></li>
							<li class="nav-header"><s:message code="navbar.transfers.historic" /></li>
							<c:forEach items="${accountsMap}" var="account">
								<li><a href="${rootURL}transfer/${account.key}">${account.value}</a></li>
							</c:forEach>
						</u:active>
					</ul>
					<p class="navbar-text pull-right">
						<security:authentication property="principal.firstname" /><jsp:text> </jsp:text><security:authentication property="principal.lastname" /> - <a href="${rootURL}j_spring_security_logout"><s:message code="navbar.logout" /></a>
					</p>
				</nav>
			</div>
		</div>
	</div>
</jsp:root>